//
//  MYPersonal_HttpAPI.m
//  MiYuan_iOS
//
//  Created by zhangyongbing on 2018/5/14.
//  Copyright © 2018年 zhangyongbing. All rights reserved.
//

#import "MYPersonal_HttpAPI.h"
NSString *const MYURLPath_GetPersonalInformation
 = @"/app/myself/myinformation";
NSString *const MYURLPath_GetMyReplenushmentList = @"/app/myself/getReplenishmentList";

@implementation MYPersonal_HttpAPI

+ (void)myGetPersonalInformationWithcomplationHandler:(OCJHttpResponseHander)handler {
    NSMutableDictionary *mDic = [NSMutableDictionary dictionary];
    
    [[OCJNetWorkCenter sharedCenter] ocj_POSTWithUrlPath:MYURLPath_GetPersonalInformation parameters:mDic andLodingType:OCJHttpLoadingTypeNone completionHandler:^(OCJBaseResponceModel *responseModel) {
        handler(responseModel);
        
        if (![responseModel.ocjStr_code isEqualToString:@"0"]) {
            [SGInfoAlert showInfo:responseModel.ocjStr_message
                          bgColor:[[UIColor blackColor] CGColor]
                           inView:[[UIApplication sharedApplication] keyWindow]
                         vertical:0.7];
        }
    }];
}

+ (void)myMyReplenushmentListWithparameter:(NSString *)parameter
                                      Time:(NSString *)time
                                   PageNum:(NSString *)pagenum
                                  PageSize:(NSString *)pagesize
                         complationHandler:(OCJHttpResponseHander)handler {
    NSString *startime = [NSString stringWithFormat:@"%@ 00:00:00",time];
    NSString *endime = [NSString stringWithFormat:@"%@ 23:59:59",time];
    NSMutableDictionary *mDic = [NSMutableDictionary dictionary];
    [mDic setObject:parameter forKey:@"parameter"];
    [mDic setObject:pagenum forKey:@"current"];
    [mDic setObject:pagesize forKey:@"size"];
    [mDic setObject:startime forKey:@"startTime"];
    [mDic setObject:endime forKey:@"endTime"];
        
    [[OCJNetWorkCenter sharedCenter] ocj_POSTWithUrlPath:MYURLPath_GetMyReplenushmentList parameters:mDic andLodingType:OCJHttpLoadingTypeNone completionHandler:^(OCJBaseResponceModel *responseModel) {
        handler(responseModel);
        
        if (![responseModel.ocjStr_code isEqualToString:@"0"]) {
            [SGInfoAlert showInfo:responseModel.ocjStr_message
                          bgColor:[[UIColor blackColor] CGColor]
                           inView:[[UIApplication sharedApplication] keyWindow]
                         vertical:0.7];
        }
    }];
}


@end
